//
//  TimePickerCell.h
//
//  Created by Olof Millberg on 2010-04-09.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {
	TimePickerTypeTimeInterval,
	TimePickerTypeStartStopTime
} TimePickerType;

@protocol WOTimePickerDelegate;

@interface TimePickerCell : UITableViewCell <UIActionSheetDelegate> 
{
	BOOL enabled;
	UIButton *deleteButton;
	UIButton *timeTypeButton;
	UIButton *timeIntervalButton;
	NSDate *startTime;
	NSDate *stopTime;
	NSString *timeType;
	NSTimeInterval timeInterval;
	TimePickerType timePickerType;
	id<WOTimePickerDelegate> delegate;
	UIDatePicker *timePicker;
	NSMutableArray *timeTypes;
}

@property (nonatomic, assign) BOOL enabled;
@property (nonatomic, retain) IBOutlet UIButton *deleteButton;
@property (nonatomic, retain) IBOutlet UIButton *timeTypeButton;
@property (nonatomic, retain) IBOutlet UIButton *timeIntervalButton;
@property (nonatomic, retain) NSDate *startTime;
@property (nonatomic, retain) NSDate *stopTime;
@property (nonatomic, retain) NSString *timeType;
@property (nonatomic, assign) NSTimeInterval timeInterval;
@property (nonatomic, assign) TimePickerType timePickerType;
@property (nonatomic, assign) id<WOTimePickerDelegate> delegate;
@property (nonatomic, retain) NSMutableArray *timeTypes;

- (IBAction) showTimeTypeMenu:(id)sender;
- (IBAction) showTimeIntervalPicker:(id)sender;
- (IBAction) deleteButtonClicked:(id)sender;

@end

@protocol WOTimePickerDelegate

- (void) timePickerCell:(TimePickerCell*)timePickerCell didChangeTimeType:(NSString *)newTimeType;
- (void) timePickerCell:(TimePickerCell*)timePickerCell didChangeTimeInterval:(NSTimeInterval)newTimeInterval;
- (void) timePickerCellDeleteButtonClicked:(TimePickerCell*)timePickerCell;

@end